a = [{'a':123,'b':111},{'a':456,'b':111},{'a':789,'b':111}]
b = {}
with open('weite.csv','w',encoding='utf-8')as f:
    for i in a:
        x = i.get('a')
        y = i.get('b')
        b[x] = y
        line = '%s,%s\n'%(x,y)
        f.write(line)

